from rest_framework import serializers

from news.models import News, NewsCategory


class Newstop(serializers.ModelSerializer):
    class Meta:
        model = News
        fields = ("id", "title", "img_url", "tags", "zhaiyao", "click", "status", "is_top", "is_slide", "create_time",
                  "update_time", "source", "author", "category")


class SNewsCategory(serializers.ModelSerializer):
    """分类新闻"""

    class Meta:
        model = NewsCategory
        fields = ('id', 'title')

# class SONCategory((serializers.ModelSerializer):
